<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>终止Promise链条</title>
</head>

<body>
    <!--
        终止Promise链条主要就是为了返回一个pending状态的Promise实例化对象
    -->
    <script>
        new Promise((resolve, reject) => {
            resolve(1);
        }).then(value => {
            console.log(value);
        }).then(value => {
            console.log(22222);
        }).then(value => {
            console.log(33333);
            //return false;
            //throw '异常';
            return new Promise(() => { })
        }).then(value => {
            console.log(44444);
        }).then(value => {
            console.log(55555);
        }).catch(reason => {
            console.log(reason);
        })
    </script>
</body>

</html>